import request from "@/utils/request";

// 查询平台商品列表
export function listplatformProducts(params) {
  return request({
    url: "/mes/md/platformProduct/list",
    method: "get",
    params,
  });
}

// 新增平台商品
export function addplatformProduct(data) {
  return request({
    url: "/mes/md/platformProduct",
    method: "post",
    data,
  });
}

// 查询平台商品详情
export function getplatformProduct(id) {
  return request({
    url: `/mes/md/platformProduct/${id}`,
    method: "get",
  });
}

// 编辑平台商品
export function editplatformProduct(data) {
  return request({
    url: `/mes/md/platformProduct`,
    method: "put",
    data,
  });
}

// 获取导入模板
export function getImportTemplate() {
  return request({
    url: "/mes/md/platformProduct/importTemplate",
    method: "post",
  });
}

// 导入平台商品
export function importplatformProduct(data) {
  return request({
    url: "/mes/md/platformProduct/importData",
    method: "post",
    data,
  });
}

// 上传图片
export function uploadImage(data) {
  return request({
    url: "/common/uploadMinio",
    method: "post",
    data,
  });
}
